import React, { useEffect } from 'react';
import { Layout } from 'antd';
import IndexSider from "@/pages/Index/components/IndexSider";
import IndexHeader from "@/pages/Index/components/IndexHeader";
import "./index.less";
import IndexContent from "@/pages/Index/components/IndexContent";
import IndexFooter from "@/pages/Index/components/IndexFooter";
import { getInfoAsync } from "@/store/slices/auth";
import { useAppDispatch } from "@/hooks";

const Index: React.FC = () => {
    const dispatch = useAppDispatch();
    useEffect(() => {
        (async () => {
            await dispatch(getInfoAsync())
        })();

        // dispatch(getInfoAsync())
    }, [])
    return (
        <Layout style={{ minHeight: '100vh' }}>
            <IndexSider />
            <Layout className="site-layout">
                <IndexHeader />
                <IndexContent />
                <IndexFooter />
            </Layout>
        </Layout>
    );
};

export default Index;